<template>
  <div>
      <button @click="isShow = !isShow">显示/隐藏</button>
      <transition-group name="vue" appear>
       <h1 v-show="isShow" key="1">你好啊！</h1>
       <h1 v-show="isShow" key="2">VUE！</h1>
      </transition-group>
  </div>
</template>

<script>
export default {
  name:'Test',
  data() {
      return {
          isShow:true
      }
  },
}
</script>

<style scoped>
 h1 {
     background-color: aqua;
     /* transition:  1s linear; */
 }
 .vue-enter-active,.vue-leave-active{
     transition:  1s linear;
 }
 .vue-enter,.vue-leave-to {
     transform: translateX(-100%);
 }
 .vue-enter-to,.vue-leave{
     transform: translateX(0);
 }


 
</style>